home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.9 KB | 138 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: HelloPrt.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef HELLOPRT_H
- #define HELLOPRT_H
-
- #ifndef HELLODEF_H
- #include "HelloDef.h"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWPART_H
- #include "FWPart.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWRESFIL_H
- #include "FWResFil.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWBNDSTR_H
- #include "FWBndStr.h"
- #endif
-
-
- //========================================================================================
- // Forward Declarations
- // Any references to imported classes (FW_) have to be wrapped in import on/off
- // because SCpp won't import their methods otherwise. This is a temporary bug fix.
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import on
- #endif
- class FW_CLASS_ATTR FW_CPart;
- class FW_CLASS_ATTR FW_CString;
- class FW_CLASS_ATTR FW_CMenuBar;
- class FW_CLASS_ATTR FW_CMenuEvent;
- class FW_CLASS_ATTR FW_CPresentation;
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import off
- #endif
-
- //========================================================================================
- // CHelloPart
- //========================================================================================
-
- class FW_CLASS_ATTR CHelloPart : public FW_CPart
- {
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CHelloPart(ODPart* odPart);
- virtual ~CHelloPart();
-
- virtual void Initialize(Environment* ev); // Override
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CFrame* NewFrame(Environment* ev,
- ODFrame* odFrame,
- FW_CPresentation* presentation,
- FW_Boolean fromStorage);
-
- virtual FW_Boolean DoAdjustMenus(Environment* ev,
- FW_CMenuBar* menuBar,
- FW_Boolean hasMenuFocus,
- FW_Boolean isRoot);
-
- virtual FW_Boolean DoMenu(Environment* ev,
- const FW_CMenuEvent& theMenuEvent);
-
- virtual void ExternalizeContent(Environment *ev,
- ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo);
-
- virtual void InternalizeContent(Environment *ev,
- ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo);
-
- virtual void AddProperties(Environment *ev, ODStorageUnit* storageUnit);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- const FW_CString& GetTextData();
- void ClearTextData();
- void SetTextData(const FW_CString& newText);
-
- void GetData(Environment* ev, FW_Boolean& setting, FW_CString& string);
- void SetData(Environment* ev, FW_Boolean setting, const FW_CString& string);
- void ClearData(Environment* ev, FW_Boolean setting);
-
- void DoHelloCommand(Environment* ev, ODCommandID id);
- // Handle our two menu commands, cFirstCommand and cSecondCommand
-
- void GetResourceString(FW_ResourceId multiStringId,
- FW_ResourceId stringId,
- FW_CString& string);
- // Retrieve a string from a multi-string resource in the part's resource file
-
- void PartChanged(Environment* ev);
- // Call this after changing part data, to notify the proper authorities
-
- static const ODValueType kPartKind;
- static const ODValueType kPartUserName;
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CString255 fTextData1; // first string
- FW_CString255 fTextData2; // second string
- FW_Boolean fIsFirstString; // is first string showing?
- FW_CPresentation* fPresentation;
- };
-
-
- #endif
-